package cate.game.role.friend.aid.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBFriendAid;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "借用某个食灵 的请求")
public class FriendAidBorrowReq implements MsgInput {
    @NoteField("功能ID")
    public int funcId;
    @NoteField("玩家uid")
    public String roleUid;
    @NoteField("食灵uid")
    public String heroUid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFriend().borrowAidHero(funcId, roleUid, heroUid);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBFriendAid.LIST_BORROW_REQ;
    }
}
